<template>
  <div>
    <add-record v-if="node.stepType === 'CREATE_ROW'" :dialog="dialog" :node="node" @setProperties="setProperties" @close="close"></add-record>
    <delete-record v-if="node.stepType === 'DELETE_ROW'" :dialog="dialog" :node="node" @setProperties="setProperties" @close="close"></delete-record>
    <send-notice v-if="node.stepType === 'SEND_NOTICE'" :dialog="dialog" :node="node" @setProperties="setProperties" @close="close"></send-notice>
    <webhook-node v-if="node.stepType === 'SEND_WEBHOOK'" :dialog="dialog" :node="node" @setProperties="setProperties" @close="close"></webhook-node>
    <!-- <approval v-if="node.stepType === 'UPDATE_ROW'" :dialog="dialog" :node="node" @setProperties="setProperties" @close="close"></approval> -->
    <update-record v-if="node.stepType === 'UPDATE_ROW'" :dialog="dialog" :node="node" @setProperties="setProperties" @close="close"></update-record>
  </div>
</template>

<script>
import AddRecord from './actions/addRecord.vue'
import DeleteRecord from './actions/deleteRecord.vue'
import SendNotice from './actions/sendNotice.vue'
import WebhookNode from './actions/webhookNode.vue'
import Approval from './actions/approval.vue'
import UpdateRecord from './actions/updateRecord.vue'
export default {
  components: {
    AddRecord,
    DeleteRecord,
    SendNotice,
    WebhookNode,
    Approval,
    UpdateRecord,
  },
  props: {
    dialog: {
      type: Boolean,
      default: false
    },
    node: {
      type: Object,
      default: undefined
    }
  },
  data(){
      return {
      }
  },
  methods: {
    setProperties(data){
      this.$emit('setProperties', data)
    },
    close(){
      this.$emit('update:dialog', false)
    }
  },
  computed:{
  }
}
</script>

<style scoped>
</style>